<?php
/********************************************************
 *
 * 此文件的作用:
 *		公告表的入口
 *
 * @copyright Copyright (c) 2008-2009
 * @author 刘昌功 lcg635@126.com
 *
 ********************************************************/
defined('APP_DIR') or die('404 Not Found');

FLEA::loadClass('Common_Table');

class Table_Notice extends Common_Table {
    var $tableName = 'notice';
    var $primaryKey = 'notice_id';

	function form($data = null) {
		$this->_ui = FLEA::initWebControls();
		$form = array(
			'notice_id' => $this->_ui->control('Hidden', 'notice_id',
				array(
					'value' => $data['notice_id']
				),
				true
			),
			'title' => $this->_ui->control('Textbox', 'title',
				array(
					'value' => $data['title'],
					'required' => 'true',
					'size' => 97,
					'showName' => '公告标题'
				),
				true
			),
			'content' => $this->_ui->control('Fckeditor', 'content',
				array(
					'Value' => $data['content'],
					'Width' => 520
				),
				true
			),
			'effectDate' => $this->_ui->control('Textbox', 'effectDate',
				array(
					'value' => $data['effectDate'],
					'check' => 'isDate(\'YYYY-MM-DD\');',
					'showName' => '有效日期'
				),
				true
			),
			'important' => $this->_ui->control('Checkbox', 'important',
				array(
					'value' => 1,
					'checked' => true == $data['important'] ? 'checked' : ''
				),
				true
			),
			'author' => $this->_ui->control('Textbox', 'author',
				array(
					'value' => $data['author'],
					'required' => 'true',
					'showName' => '作者'
				),
				true
			)
		);
		return $form;
	}
}
